<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
        <title>36jQuery展开和收起动画</title>
        <style>
            *{
                margin: 0;
                padding: 0;
            }
            div{
                width: 100px;
                height: 300px;
                background: red;
                display: none;
            }
        </style>
        <script src="http://code.jquery.com/jquery-1.12.4.js" 
        integrity="sha256-Qw82+bXyGq6MydymqBxNPYTaUXXq7c8v3CwiYwLLNXU="
        crossorigin="anonymous"></script>
        <script>
            $(function (param) {  
                $("button").eq(0).click(function (param) {  
                    $("div").slideDown(1000,function (param) {  
                        alert("展开完毕");
                    });
                });
                $("button").eq(1).click(function (param) {  
                    $("div").slideUp(1000,function (param) {  
                        alert("收起完毕");
                    });
                });
                $("button").eq(2).click(function (param) {  
                    $("div").slideToggle(1000,function (param) {  
                        alert("切换完毕");
                    });
                });
            });
        </script>
    </head>
    <body>
        <button>展开</button>
        <button>收起</button>
        <button>切换</button>
        <div></div>
    </body>
</html>